package com.ruoyi.test_tree.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.test_tree.mapper.DevicePurposeMapper;
import com.ruoyi.test_tree.domain.DevicePurpose;
import com.ruoyi.test_tree.service.IDevicePurposeService;

/**
 * 设备用途Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-11
 */
@Service
public class DevicePurposeServiceImpl implements IDevicePurposeService 
{
    @Autowired
    private DevicePurposeMapper devicePurposeMapper;

    /**
     * 查询设备用途
     * 
     * @param purposeId 设备用途主键
     * @return 设备用途
     */
    @Override
    public DevicePurpose selectDevicePurposeByPurposeId(Long purposeId)
    {
        return devicePurposeMapper.selectDevicePurposeByPurposeId(purposeId);
    }

    /**
     * 查询设备用途列表
     * 
     * @param devicePurpose 设备用途
     * @return 设备用途
     */
    @Override
    public List<DevicePurpose> selectDevicePurposeList(DevicePurpose devicePurpose)
    {
        return devicePurposeMapper.selectDevicePurposeList(devicePurpose);
    }

    /**
     * 新增设备用途
     * 
     * @param devicePurpose 设备用途
     * @return 结果
     */
    @Override
    public int insertDevicePurpose(DevicePurpose devicePurpose)
    {
        return devicePurposeMapper.insertDevicePurpose(devicePurpose);
    }

    /**
     * 修改设备用途
     * 
     * @param devicePurpose 设备用途
     * @return 结果
     */
    @Override
    public int updateDevicePurpose(DevicePurpose devicePurpose)
    {
        return devicePurposeMapper.updateDevicePurpose(devicePurpose);
    }

    /**
     * 批量删除设备用途
     * 
     * @param purposeIds 需要删除的设备用途主键
     * @return 结果
     */
    @Override
    public int deleteDevicePurposeByPurposeIds(Long[] purposeIds)
    {
        return devicePurposeMapper.deleteDevicePurposeByPurposeIds(purposeIds);
    }

    /**
     * 删除设备用途信息
     * 
     * @param purposeId 设备用途主键
     * @return 结果
     */
    @Override
    public int deleteDevicePurposeByPurposeId(Long purposeId)
    {
        return devicePurposeMapper.deleteDevicePurposeByPurposeId(purposeId);
    }
}
